|
Table of Contents
NOTE: you can find this and other lessons in a
more complete and viewable format (including all Figures) in our Tutorial PDF.
Lesson 1. How to Make an SMF Report in 5 Minutes
-
This lesson teaches you how to make a simple SMF report in just 5 minutes using only three control statements. These statements are:
-
the
INPUT
statement
-
the
COLUMNS
statement
-
You can make a SMF report with just these statements:
INPUT: SMF14 /* COPY SMF 14 RECORD DEFINITIONS */
INCLUDEIF: SMF14RTY = 14 /* SELECT JUST TYPE 14 RECORDS */
COLUMNS: SMF14DTE SMF14TME SMF14JBN SMF14PGN SMF14TIOE5 SMF14_JFCBDSNM SMF14_JFCLRECL SMF14EXCP
-
Figure 1 shows the report created from these statements.
A report produced with just three control statements
A report produced with just three control statements
|
How to Use the INPUT Statement
-
The copy library PDS that you installed with Spectrum SMF Writer contains the SMF record layouts for dozens of SMF record types.
-
The very first step in requesting an SMF report is to tell Spectrum SMF Writer which one of these SMF records has the data needed for your report. Use the
INPUT
statement to do this. For example:
INPUT: SMF14
-
The above statement tells Spectrum SMF Writer that you want to produce a report using data from the type 14 SMF records. (Each SMF 14 record contains information about one input data set referenced during the execution of a job or task.)
-
The
INPUT
statement above does these two things:
1) it copies the statements from member
SMF14
in the copy library (which in turn copies another member named
REC17
). Those members define the SMF input file and describe all of the fields available in the SMF 14 record. That lets you refer to any of those fields in the control statements that follow.
2) it also sets this newly defined
SMF14
file as the primary (and in this case only) input file for this report.
Basic Syntax
-
All Spectrum SMF Writer control statements begin in column 1 with the name of the statement (for example,
INPUT
), followed immediately by a colon. What follows next will depend on the particular control statement. For an
INPUT
statement, you simply put the name of the SMF file to use for the report.
The INCLUDEIF Statement
-
We also used an
INCLUDEIF
statement. That tells Spectrum SMF Writer to "include" a record from the SMF file only "if" its record type equals 14. We will go into more detail about the
INCLUDEIF
statement in the next lesson.
How to Use the COLUMNS Statement
-
After specifying the desired SMF record type in the
INPUT
and
INCLUDEIF
statements, the next step is to tell Spectrum SMF Writer which fields from that record you want to see in your report. Use the
COLUMNS
statement to do that. Each field named in this statement will appear as one column of data in the report. For example:
INPUT: SMF14 /* COPY SMF 14 RECORD DEFINITIONS */
INCLUDEIF: SMF14RTY = 14 /* SELECT JUST TYPE 14 RECORDS */
COLUMNS: SMF14DTE SMF14TME SMF14JBN SMF14PGN SMF14TIOE5 SMF14-JFCBDSNM SMF14-JFCLRECL SMF14EXCP
-
The
COLUMNS
statement above tells Spectrum SMF Writer that we want columns in our report that show the date and time the SMF record was written, the job name, program name,
DDNAME
,
DSNAME
,
LRECL
and count of
EXCP
's for that dataset.
-
You may specify as many fields as there is room for in the report.
-
With just the three statements shown above, we have given Spectrum SMF Writer everything it needs to produce the attractive report in Figure 1. This report has:
-
a default title containing the name of the input file, as well as the date, time, day of the week, and page number
-
the columns of data that we requested, appearing in the same order as we requested
-
neat, underlined column headings identifying each column of data
-
date, time and numeric fields that are properly formatted
-
a Grand Totals line which shows totals for each of the numeric columns
-
an item count, showing the number of records included in the report
What Files and Fields Are Available?
-
You may be wondering what files can be named in the
INPUT
statement. And what fields are available for the
COLUMNS
statement. The answers can be found in the Spectrum SMF Writer "copy library." Each PDS member that begins with "
SMF
" is the file definition for a particular SMF record. (Or for a particular subtype of some of the complex SMF record types.) Choose from these names for your
INPUT
statement.
-
The members beginning with "
REC
" contain the definitions for the individual fields for a given record. These are the fields you can choose from for your
COLUMNS
statement (and other statements that you will be learning about.)
-
You can browse the copy library PDS to see what is available for you to report on. You can also get a list of all of the fields available for a file by just adding the
SHOWFLDS(YES)
parm to your
INPUT
statement, like this:
INPUT: SMF14 SHOWFLDS(YES)
-
The above statement tells Spectrum SMF Writer to print (in the control statement listing) a list of all of the fields defined for
SMF14
.
What about non-SMF Files?
-
You may be thinking that this would be a very handy tool to use with other files that you are always making quick-and-dirty reports for. Or that have data you need to export into a PC spreadsheet. You are absolutely right! This is the perfect tool for all of those frequent ad-hoc requests that come up. And you won't even need to learn a new language.
-
To address those needs, we offer a full-license version of this same program. It is called Spectrum Writer. Spectrum Writer can report on any file in your shop -- and even on DB2 tables. Call us to ask about upgrading your current license to a license for our full Spectrum Writer product. It does everything Spectrum SMF Writer does and more!
-
We also permit you to use your current software to experiment (for non-productive purposes) with other files to actually see just how it works out for your shop. The software you now have allows you to report on a limited number of records from non-SMF files. See ... in the User's Guide to see how to easily set up a definition for any file you like. You can even use your existing COBOL or Assembler record layouts.
To Learn More
-
The page numbers below refer to pages in the User's Guide and Reference Manual.
-
You can also learn:
-
about writing control statements in general
-
how to make a report column that contains a literal text
-
how to print multiple report lines for each input record
-
how to produce reports that are wider than 132 characters
-
the complete syntax for the
INPUT, INCLUDEIF
and
COLUMNS
statements
NEXT LESSON: How to Export SMF Data to PC Programs
|